#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
ll p, q, n, s;

int main() {
    n = 2000000;

    for (p = 1; p <= n / 2; p++) {
        //f(q)=p+...q  ���㵥����
        ll left = p + 1, right = n;
        while (left <= right) {
            q = (left + right) / 2;
            s = (p + q) * (q - p + 1) / 2;
            if (s == n) {
                cout << p << " " << q << endl;
                break;
            } else if (s > n) {
                right = q - 1;
            } else {
                left = q + 1;
            }
        }
    }
}
